package com.api.user.dao;

import com.api.base.model.User;
import com.api.common.mybatis.ResultMap;
import com.api.core.ApiMapper;
import com.api.user.model.UserInfo;
import com.api.user.vo.UserInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Mapper
public interface UserInfoMapper extends ApiMapper<UserInfo> {


    List<Map<String, Object>> list(@Param("params") Map<String, Object> params,@Param("order") Map<String, Object> orderParams);
    List<Map<String, Object>> friendList(@Param("params") Map<String, Object> params,@Param("order") Map<String, Object> orderParams);

    ResultMap<String, Object> detail(Long userId);

    /**
     * 更新用户金币
     *
     * @param userId
     * @param newCoin
     * @return
     */
    int updateCoin(@Param("userId") Long userId, @Param("newCoin") BigDecimal newCoin, @Param("originalCoin") BigDecimal originalCoin);

    /**
     * 查询用户基础信息
     *
     * @param userIds
     * @return
     */
    List<UserInfoVo> findUserBaseInfo(@Param("userIds") List<Long> userIds);

    User findByLoginName(String loginName);

    void vipExpire();
}